<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<script>

function submitOrder(){
	//$.mobile.loading("show",{ theme: "b", text: "正在加载数据", textonly: false});
	var data="formBean.comment="+ $("#comment").val();
    $.post('<%=request.getContextPath()%>/action/ipadJSON!submitOrder', data, 
    		function(result) {
    			
    			if (result.returnCode == 2) {

    				goToIndex();
    				
    			} else {
    				$.mobile.loading("hide");
    				alert("系统错误  : " + result.message);
    			}
    		}, 'JSON');
}

function goToIndex(){
	window.location.href = "<%=request.getContextPath()%>/action/ipadJSP!goToEditCustPDA";
}

function logoff(){
	window.location.href = "<%=request.getContextPath()%>/action/ipadJSP!logoffPDA";
}
</script>
<div data-role="header" data-theme="b" data-position="fixed" data-tap-toggle="false">
      <a href="#" data-transition="fade" onclick="logoff();">退出PDA</a>
      <a href="#" data-rel="dialog" data-transition="fade" onclick="$('#submitPopup').popup('open');">提交单据</a>
	  <h4><c:out value="${sessionScope.HQ_SESSION_INFO_CUSTNAME}" escapeXml="false" default="未选客户"></c:out></h4>
</div> 

<div data-role="popup" id="submitPopup"
                    data-dismissible="true" style="max-width: 400px; min-width: 250px"
                    class="ui-popup ui-body-inherit ui-overlay-shadow ui-corner-all">
                    <div data-role="header">
                        <h3 id="errorHeader"></h3>
                        <a class="ui-btn-right" href="#" data-role="button" data-iconpos="notext" data-icon="delete" data-rel="back" data-theme="a">Close</a>
                    </div>
                    <div role="main" class="ui-content">
                        <label for="textarea">单据备注信息</label>
                        <textarea cols="10" rows="8"  name="comment" id="comment"></textarea>
                        <input type="button" value="单据提交" data-theme="a" onclick="submitOrder();">
                    </div>
</div> 